package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class SelfReferencingColumnSpecification implements TableElement, ViewElement {

    private int beginIndex;
    private int endIndex;
    private Identifier selfReferencingColumnName;
    private ReferenceGeneration referenceGeneration;

    public SelfReferencingColumnSpecification(int beginIndex,
                                              Identifier selfReferencingColumnName,
                                              ReferenceGeneration referenceGeneration) {
        this.beginIndex = beginIndex;
        this.endIndex = referenceGeneration.getEndIndex();
        this.selfReferencingColumnName = selfReferencingColumnName;
        this.referenceGeneration = referenceGeneration;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public Identifier getSelfReferencingColumnName() {
        return selfReferencingColumnName;
    }

    public ReferenceGeneration getReferenceGeneration() {
        return referenceGeneration;
    }

}
